<!DOCTYPE html>
<html>
<head>
<title>to_change.html</title>

<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="this is my page">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<script src="../../statics/js/jquery-1.12.4.js"></script>
<link rel="stylesheet" href="../../layui/css/layui.css" />
<script type="text/javascript" src="../../layui/layui.js"></script>
<script type="text/javascript" src="../../assets/data.js"></script>
<script type="text/javascript" src="../../assets/province.js"></script>
</head>
<body >
	<form class="container layui-form">
		<div class="layui-form-item" style="margin: 15px 0 0 0;">
			<label class="layui-form-label">初审接收人</label>
			<div class="layui-input-inline" id="open1" style="width:12%;">
				<select name="openid" class="select1">
					<option value="">----------请选择----------</option>

				</select>
			</div>
			<div class="layui-inline">
				<button type="button" class="layui-btn layui-btn-normal add" >修改初审人员</button>
			</div>
		</div>

        <div class="layui-form-item" style="margin: 15px 0 0 0;">
			<label class="layui-form-label">复审接收人</label>
			<div class="layui-input-inline" id="open2" style="width:12%;">
				<select name="openid2" class="select1">
					<option value="">----------请选择----------</option>
				</select>
			</div>
			<div class="layui-inline">
				<button type="button" class="layui-btn layui-btn-normal add2">修改复审人员</button>
			</div>
		</div>
		
		<div class="table-listm roll-x">
			<table id="to_enter_manager" lay-filter="to_enter_manager">
			</table>
		</div>
	</form>
</body>
<script type="text/javascript">
	//这个


</script>
<script type="text/javascript">
	layui
			.use(
					[ 'jquery', 'laydate', 'form', 'layer', 'laypage', 'table' ],
					function() {
						var $ = layui.jquery, laydate = layui.laydate, layer = layui.layer, table = layui.table, laypage = layui.laypage,form = layui.form;

						table.render({
							elem : '#to_enter_manager',
							//height : 'full-50',
							id : 'channel_user_table_id',
							url : '../../web/selUpd',
							//page: true ,
							loading : true,
							text : {
								none : '暂无相关数据'
							},
							cellMinWidth : 80,
							cols : [ [{type: 'numbers', title: '序号', width: '30'},{type: 'checkbox'}
							, {
								field : 'wx_nickname',
								width : '30%',
								title : '接收人'
							},{
								field : 'type',
								width : '30%',
								title : '类别',
								templet:function (d) { 
								   if(d.type=="1"){
		        		            return "初审人员"  ;
		        		           }
		        		           else{
		        		            return "复审人员"  ;
		        		           }
				  				}
							}
							 ] ],
							done : function(res) {

							},

						});
                        add();
                        function add() {
                            $.ajax({
                                url:"../../web/reviewSel",
                                // data:{
                                //     data:data
                                // },
                                dataType:"json",
                                type:"GET",
                                success:function (data) {
                                    var list = data.data;
                                    var option = "";
                                    for(var i=0;i<list.length;i++){
                                        option += "<option value='"+list[i].open_wx_id+"'>"+list[i].name_wx+"</option>";
                                    }
                                    $(".select1").html(option);
                                    form.render();
                                }
                            });
                        }

						$(document).on("click", ".add", function() {
						    var openid = $("select[name='openid']").val();
							if (openid != null && openid != "") {
								$.ajax({
									type : "GET",
									url : "../../rest/noUpd",
									data : {
										"openid" : openid
									},
									dataType : "json",
									success : function(data) {
										alert("修改成功");
										//parent.location.reload();
										table.reload('channel_user_table_id');
									}
								});
							}
						});
						
						$(document).on("click", ".add2", function() {
						   		var openid = $("select[name='openid2']").val();
								if (openid != null && openid != "") {
									$.ajax({
										type : "GET",
										url : "../../rest/noUpd2",
										data : {
											"openid" : openid
										},
										dataType : "json",
										success : function(data) {
											alert("修改成功");
											//parent.location.reload();
											table.reload('channel_user_table_id');
										}
									});
									
								}
						});

					});

</script>
</html>